#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(smsrouter, 1.0)
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB

ismacplatform="no"
case "$host_os" in
    [darwin*])
       ismacplatform="yes"
       ;;
esac

AC_DEFUN([CONDITIONAL_DEFINE],
[AM_CONDITIONAL([$1],[$2])
if test -z "$$1_TRUE" ; then
   AC_DEFINE([$1],[1],[$3])
fi])

CONDITIONAL_DEFINE([PLAT_MAC],[test "$ismacplatform" = "yes"],[build on mac platform])

# Checks for libraries.
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0.0])
PKG_CHECK_MODULES([XML], [libxml-2.0 >= 2.0])
PKG_CHECK_MODULES([GSOAP], [gsoap >= 2.0])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([netinet/in.h stdlib.h string.h sys/socket.h syslog.h])

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_CHECK_FUNCS([bzero socket strerror])

AC_CONFIG_FILES([Makefile
src/Makefile
md_api/Makefile
test/Makefile])
AC_OUTPUT
